import java.util.HashSet;

public class e073 {
    public static void main(String[] args) {
		long sTime = System.currentTimeMillis();
        HashSet<Double> fractList = new HashSet<Double>();
        for (int d = 0; d <= 12000; d++) {
            for (int n = 1; n < d; n++) {
                if (gcd(n, d) == 1 ){
                    double p = (double)n / (double)d;
                    if (p < 0.5 && p > (double)1/3){
                        if (!fractList.contains(p)) {
                            fractList.add(p);
                        }
                    }
                }
            }
        }
        System.out.println(fractList.size());
		long fTime = System.currentTimeMillis();
		System.out.println("Time: " + (fTime - sTime) + "ms"); 
    }

    static int gcd(int a, int b) {
        boolean found = false;
        int mod = a % b;
        while(true) {
            if (mod == 0) {
                return b;
            }
            int oldB = b;
            b = mod;
            mod = oldB % b;
        }
    }
}